package vip.liux.backend.infrastructure.excel.enhance;

import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import vip.liux.backend.infrastructure.excel.ExportContext;
import vip.liux.backend.infrastructure.excel.head.HeadGenerator;

import java.io.OutputStream;


/**
 * @author JiaDu
 * @version 1.0.0
 * @since 2023/10/12
 */
public class DefaultWriterBuilderEnhancer implements WriterBuilderEnhancer {

    /**
     * ExcelWriterBuilder 增强
     *
     * @param writerBuilder ExcelWriterBuilder
     * @param response      HttpServletResponse
     * @param exportExcel   ExportExcel
     * @return ExcelWriterBuilder
     */
    @Override
    public ExcelWriterBuilder enhanceExcel(ExcelWriterBuilder writerBuilder, OutputStream response,
                                           ExportContext exportExcel) {
        // doNothing
        return writerBuilder;
    }

    /**
     * ExcelWriterSheetBuilder 增强
     *
     * @param writerSheetBuilder ExcelWriterSheetBuilder
     * @param sheetNo            sheet角标
     * @param sheetName          sheet名，有模板时为空
     * @param dataClass          当前写入的数据所属类
     * @param headEnhancerClass  当前指定的自定义头处理器
     * @return ExcelWriterSheetBuilder
     */
    @Override
    public ExcelWriterSheetBuilder enhanceSheet(ExcelWriterSheetBuilder writerSheetBuilder, Integer sheetNo,
                                                String sheetName, Class<?> dataClass, Class<? extends HeadGenerator> headEnhancerClass) {
        // doNothing
        return writerSheetBuilder;
    }
}
